package com.io.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
 * Created by yangyx on 2016/8/1.
 */
public class BaseConfig {
	
	protected static PropertiesUtil propertiesUtil;
	
	BaseConfig() {}
    
    static Log logger = LogFactory.getLog(BaseConfig.class);
    
    static {
    	init();
    }
    
    private static void init() {
		String configName = "/config/resource.properties";
    	propertiesUtil = new PropertiesUtil(configName);
    }
    
    public static void reload() {
    	init();
    }
    
    public static String getPropertyValue(String key) {
    	return propertiesUtil.getProperty(key);
    }

	public PropertiesUtil getPropertiesUtil() {
		return propertiesUtil;
	}

	@SuppressWarnings("static-access")
	public void setPropertiesUtil(PropertiesUtil propertiesUtil) {
		this.propertiesUtil = propertiesUtil;
	}
}
